<!DOCTYPE html>
<html class="x-admin-sm">

<head>
    <meta charset="UTF-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
        content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <!-- <link rel="stylesheet" href="./css/font.css"> -->
    <link rel="stylesheet" href="./css/xadmin.css">
    <link rel="stylesheet" href="/lib/layui/css/layui.css.css">
    <script src="/lib/layui/css/layui.css" charset="utf-8"></script>
    <script type="text/javascript" src="./js/xadmin.js"></script>
    <script src="/js/jquery.min.js"></script>
    <!--[if lt IE 9]>
                <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
                <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
                <![endif]-->

    <style>
        .layui-tab {
            background-color: #fff;
            margin: 20px;
        }

        .layui-form-label {
            line-height: 13px;
            font-weight: 700
        }

        .layui-input-block {
            margin-right: 300px;
        }

        .layui-form-checked[lay-skin=primary] i {
            background: rgb(27, 132, 252) !important;
            border-color: rgb(0, 110, 255);
        }

        .layui-textarea {
            min-height: 70px;
        }

        .layui-form-onswitch {
            background: rgb(27, 132, 252) !important;
            border-color: rgb(0, 110, 255);
        }
    </style>
</head>

<body>
    <div class="x-nav">
        <span class="layui-breadcrumb">
            <a href="">首页</a>
            <a href="">演示</a>
            <a>
                <cite>导航元素</cite></a>
        </span>
        <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
            onclick="location.reload()" title="刷新">
            <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
    </div>
    <!-- form表单 -->
    <form class="layui-form" id="info">
        <div class="layui-tab layui-tab-card">
            <ul class="layui-tab-title">
                <li class="layui-this">基础信息</li>
                <li>SEO信息</li>
                <li>文章内容</li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <div class="layui-form-item">
                        <label class="layui-form-label">标题</label>
                        <div class="layui-input-block">
                            <input type="text" name="title" required lay-verify="required" placeholder="请输入标题"
                                autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">作者</label>
                        <div class="layui-input-inline">
                            <input type="text" name="author" required lay-verify="required" placeholder="请输入作者"
                                autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-input-inline">
                            <select name="cateid"></select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">收藏数量</label>
                        <div class="layui-input-inline">
                            <input type="text" name="lovenum" required lay-verify="required" placeholder="请输入收藏数量"
                                autocomplete="off" class="layui-input">
                        </div>
                        <label class="layui-form-label">阅读次数</label>
                        <div class="layui-input-inline">
                            <input type="text" name="click" required lay-verify="required" placeholder="请输入阅读次数"
                                autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">创建时间</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" id="test1" name="create_date">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">是否置顶</label>
                        <div class="layui-input-inline" style="width:80px">
                            <input type="checkbox" name="istop" class="istop" lay-skin="switch" lay-filter="istop">
                        </div>
                        <label class="layui-form-label">是否推荐</label>
                        <div class="layui-input-inline">
                            <input type="checkbox" name="ishot" class="ishot" lay-skin="switch" lay-filter="ishot">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">文章缩略图</label>
                        <div class="layui-input-inline">
                            <input type="file" id="coverFile" style="display: none;">
                            <button type="button" id="file" class="layui-btn layui-btn-normal">点击上传</button>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <img src="" id="image" width="150px">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">文章标签</label>
                        <div class="layui-input-block tags">

                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn" lay-submit lay-filter="formDemo">立即上传</button>
                            <button type="button" class="layui-btn layui-btn-normal save">保存草稿</button>
                            <button type="button" class="layui-btn layui-btn-warm returnId">返回列表</button>
                        </div>
                    </div>
                </div>
                <div class="layui-tab-item">
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">SEO关键字</label>
                        <div class="layui-input-block">
                            <input type="text" name="keywords" required lay-verify="required" placeholder="请输入SEO关键字"
                                autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">SEO描述</label>
                        <div class="layui-input-block">
                            <input type="text" name="description" required lay-verify="required" placeholder="请输入SEO描述"
                                autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn" lay-submit lay-filter="formDemo">立即上传</button>
                            <button type="button" class="layui-btn layui-btn-normal save">保存草稿</button>
                            <button type="button" class="layui-btn layui-btn-warm returnId">返回列表</button>
                        </div>
                    </div>
                </div>
                <div class="layui-tab-item">
                    <div class="layui-form-item">
                        <!-- 左侧的 label -->
                        <label class="layui-form-label">文章内容</label>
                        <!-- 为富文本编辑器外部的容器设置高度 -->
                        <div class="layui-input-block" style="height: 400px;">
                            <!-- 重要：将来这个 textarea 会被初始化为富文本编辑器 -->
                            <textarea name="content"></textarea>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn" lay-submit lay-filter="formDemo">立即上传</button>
                            <button type="button" lay-submit lay-filter="formDemo"
                                class="layui-btn layui-btn-normal save">保存草稿</button>
                            <button type="button" class="layui-btn layui-btn-warm returnId">返回列表</button>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </form>

</body>


<!-- 分类模板引擎 -->
<script type="text/html" id='tpl_cate'>
    <option value="">请选择分类</option>
    {{each data}}
    <option value="{{$value.id}}">{{$value.catename}}</option>
    {{/each}}
</script>


<!-- 标签模板引擎 -->
<script type="text/html" id="tpl_tags">
    {{each data}}
        <input type="checkbox" name="tags" title="{{$value.tagname}}" lay-skin="primary">
    {{/each}}
</script>



<script src="/lib/layui/layui.all.js"></script>
<script src="/lib/layui/template-web.js"></script>
<script src="/js/baseAPI.js"></script>
<script src="/lib/layui/tinymce/tinymce.min.js"></script>
<script src="/lib/layui/tinymce/tinymce_setup.js"></script>

<script src="/js/addCate.js"></script>
<script>
    //注意：选项卡 依赖 element 模块，否则无法进行功能性操作
    layui.use('element', function () {
        var element = layui.element;

        //…
    });
</script>

<script>
    layui.use('laydate', function () {
        var laydate = layui.laydate;
        //执行一个laydate实例
        laydate.render({
            elem: '#test1' //指定元素
        });
    });
</script>

</html>